<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Stop rollup jobs API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'rollup-stop-job.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/rollup-stop-job.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/rollup-stop-job.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/rollup-stop-job.html" rel="nofollow" target="_blank">../en/rollup-stop-job.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="rollup-apis.html">Rollup APIs</a></span>
»
<span class="breadcrumb-node">Stop rollup jobs API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="rollup-start-job.html">« Start rollup jobs API</a>
</span>
<span class="next">
<a href="search.html">Search APIs »</a>
</span>
</div>
<div class="section xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="rollup-stop-job"></a>Stop rollup jobs API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/rollup/apis/stop-job.asciidoc">edit</a><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</h2>
</div></div></div>

<p>Stops an existing, started rollup job.</p>
<div class="warning admon">
<div class="icon"></div>
<div class="admon_content">
<p>This functionality is experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="rollup-stop-job-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/rollup/apis/stop-job.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">POST _rollup/job/&lt;job_id&gt;/_stop</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="rollup-stop-job-prereqs"></a>Prerequisites<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/rollup/apis/stop-job.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
If the Elasticsearch security features are enabled, you must have <code class="literal">manage</code> or
<code class="literal">manage_rollup</code> cluster privileges to use this API. For more information, see
<a class="xref" href="security-privileges.html" title="Security privileges">Security privileges</a>.
</li>
</ul>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h4 class="title">
<a id="rollup-stop-job-desc"></a>Description<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/rollup/apis/stop-job.asciidoc">edit</a>
</h4>
</div></div></div>
<p>If you try to stop a job that does not exist, an exception occurs. If you try
to stop a job that is already stopped, nothing happens.</p>
</div>

</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="rollup-stop-job-path-parms"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/rollup/apis/stop-job.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;job_id&gt;</code>
</span>
</dt>
<dd>
(Required, string) Identifier for the rollup job.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="rollup-stop-job-query-parms"></a>Query parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/rollup/apis/stop-job.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">timeout</code>
</span>
</dt>
<dd>
<p>
(Optional, TimeValue) If <code class="literal">wait_for_completion</code> is <code class="literal">true</code>, the API blocks for
(at maximum) the specified duration while waiting for the job to stop. If more
than <code class="literal">timeout</code> time has passed, the API throws a timeout exception. Defaults
to <code class="literal">30s</code>.
</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>Even if a timeout exception is thrown, the stop request is still
processing and eventually moves the job to <code class="literal">STOPPED</code>. The timeout simply means
the API call itself timed out while waiting for the status change.</p>
</div>
</div>
</dd>
<dt>
<span class="term">
<code class="literal">wait_for_completion</code>
</span>
</dt>
<dd>
(Optional, boolean) If set to <code class="literal">true</code>, causes the API to block until the
indexer state completely stops. If set to <code class="literal">false</code>, the API returns immediately
and the indexer is stopped asynchronously in the background. Defaults to
<code class="literal">false</code>.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="rollup-stop-job-response-codes"></a>Response codes<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/rollup/apis/stop-job.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">404</code> (Missing resources)
</span>
</dt>
<dd>
This code indicates that there are no resources that match the request. It
occurs if you try to stop a job that doesn’t exist.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="rollup-stop-job-examples"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/rollup/apis/stop-job.asciidoc">edit</a>
</h3>
</div></div></div>
<p>Since only a stopped job can be deleted, it can be useful to block the API until
the indexer has fully stopped. This is accomplished with the
<code class="literal">wait_for_completion</code> query parameter, and optionally a <code class="literal">timeout</code>:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">POST _rollup/job/sensor/_stop?wait_for_completion=true&amp;timeout=10s</pre>
</div>
<div class="console_widget" data-snippet="snippets/1884.console"></div>
<p>The parameter blocks the API call from returning until either the job has moved
to <code class="literal">STOPPED</code> or the specified time has elapsed. If the specified time elapses
without the job moving to <code class="literal">STOPPED</code>, a timeout exception is thrown.</p>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="rollup-start-job.html">« Start rollup jobs API</a>
</span>
<span class="next">
<a href="search.html">Search APIs »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>